import request from '@/utils/request'

import variable from '@/utils/variables'
const baseURL = variable.URL.baseURL

// 新闻列表
export function getNewsList(query) {
  return request({
    baseURL: baseURL,
    url: '/news/select_hotlists',
    method: 'GET',
    params: query
  })
}

// 套餐购买 套餐详情
export function mealDetail(query) {
  return request({
    baseURL: baseURL,
    url: '/meal/mealInfo/mealDetail',
    method: 'POST',
    params: query
  })
}

// 套餐购买 创建套餐订单
export function orderPayCreate(query) {
  return request({
    baseURL: baseURL,
    url: '/order/package/insert_order',
    method: 'POST',
    data: query
  })
}

// 套餐购买 创建套餐支付
export function orderPayBuild(query) {
  return request({
    baseURL: baseURL,
    url: '/order/pay/package/build_param',
    method: 'POST',
    data: query
  })
}

// 套餐购买 检查订单支付状态
export function orderPayStatus(query) {
  return request({
    baseURL: baseURL,
    url: '/order/package/is_pay_success',
    method: 'GET',
    params: query
  })
}

// 套餐购买 检查订单支付状态（pc订单）
export function orderPayStatusPc(query) {
  return request({
    baseURL: baseURL,
    url: '/order/is_pay_success',
    method: 'GET',
    params: query
  })
}

// 套餐购买 订单详情
export function orderSelectDetail(query) {
  return request({
    baseURL: baseURL,
    url: '/order/package/select_by_combo_order_no',
    method: 'GET',
    params: query
  })
}


// 订单支付
export function orderPayment(params) {
  return request({
      baseURL: baseURL,
      url: '/order/pay/build_param',
      method: 'POST',
      data: params
  })
}

//合并支付
export function orderPaymentAll(params) {
  return request({
      baseURL: baseURL,
      url: '/order/pay/re_build_param',
      method: 'POST',
      data: params
  })
}


// 收银台订单详情
export function cashierOrderDetail(query) {
  return request({
    baseURL: baseURL,
    url: '/order/cashier_order_detail',
    method: 'GET',
    params: query
  })
}
